package com.bitmain.mmst.web.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bitmain.mmst.common.consts.ResultCode.ERROR;
import com.bitmain.mmst.common.consts.ResultCode.INFO;
import com.bitmain.mmst.core.struct.ServiceResult;
import com.bitmain.mmst.domain.MinerType;
import com.bitmain.mmst.web.dao.MinerTypeDao;

/**
 * 
 *
 * @author Richard - rui.wu@bitmain.com
 * @since 2016年8月12日 
 *
 */
@Service("minerTypeService")
public class MinerTypeService {

	@Autowired
	private MinerTypeDao minerTypeDao;
	
	public ServiceResult<List<MinerType>> getAll(Map<String, Object> params) {
		ServiceResult<List<MinerType>> result = new ServiceResult<List<MinerType>>();
		List<MinerType> types;
		try {
			types = minerTypeDao.selectAll(params);
			result.setData(types);
			result.setInfo(INFO.INFO);
		} catch (Exception e) {
			System.out.println("获取矿机类型时出错");
			result.setError(ERROR.DB_SELECT);
		}
		return result;
	}

	public ServiceResult<?> modifyMinerType(MinerType type) {
		// TODO Auto-generated method stub
		return null;
	}

}
